<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script src="./js/03-ajax.js"></script>
  <script>
    // async function get(name) {
    //   let result = await ajax('http://localhost:3000/posts')
    //   console.log(result)
    // }
    // get('lisa')

    async function sleep(delay = 1000) {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve()
        }, delay)
      })
    }
    async function show () {
      for(const user of ["lisa", "json"]) {
        await sleep()
        console.log(user)
      }
    }
    show()
  </script>
</body>
</html>